﻿using Microsoft.Data.SqlClient;

namespace DatabaseProxy.Tool.Connections;
public class SqlServerConnection
{
    private string? _connectionString { get; set; }
    public SqlConnectionStringBuilder Builder = new();
    public string? ConnectionString
    {
        set
        {
            _connectionString = value;
        }
        get
        {
            if (string.IsNullOrEmpty(_connectionString)) 
                _connectionString = Builder.ConnectionString;
            return _connectionString;
        }
    }

    public SqlServerConnection(string? connectionString)
    {
        if (!string.IsNullOrEmpty(connectionString))
            _connectionString = connectionString;
    }
}
